package com.byx.chatclient.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * Friend
 *
 * @author Superb
 * @date 2021/3/26 22:48
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Friend extends SimpleFriend {
    private String password;
    private int sex;
    private int age;
    private String description;
    private String birthday;
    private String telephone;
    private String realName;
    private String email;
    private String vocation;

    public static Friend user2Friend(User user, int status){
        Friend friend = new Friend();
        friend.setFriendLoginId(user.getLoginId());
        friend.setPassword(user.getPassword());
        friend.setFriendNickName(user.getNickName());
        friend.setEmail(user.getEmail());
        friend.setTelephone(user.getTelephone());
        friend.setSex(user.getSex());
        friend.setDescription(user.getDescription());
        friend.setStatus(status);
        return friend;
    }

    public static User friend2User(Friend friend){
        User user = new User();
        user.setLoginId(friend.getFriendLoginId());
        user.setNickName(friend.getFriendNickName());
        user.setEmail(friend.getEmail());
        user.setTelephone(friend.getTelephone());
        user.setSex(friend.getSex());
        user.setDescription(friend.getDescription());
        return user;
    }
}
